import {createRouter, createWebHashHistory, createWebHistory} from 'vue-router';
import NProgress from 'vue-nprogress-ts';
// import store from '@/store';
// console.log(process.env.BASE_URL, 'process.env.BASE_URL');
const routes = [{path: '/:pathMatch(.*)*', redirect: '/index'}, {
    path: '/index',
    component: () => import('@/views/index.vue'),
    hidden: true
}];
const router = createRouter({
    history: createWebHistory(),
    routes
});

router.beforeEach((to, from, next) => {
    // to.meta.title && (document.title = to.meta.title);
    // if (store.getters.isLogin) store.dispatch('common/setMessage');
    // @ts-ignore
    // NProgress.start();
    next();
});
router.afterEach((to, from) => {
    // @ts-ignore
    NProgress.done();
});

export default router;
